1. Field of Invention
The present invention relates to a buffer management device inside a record and reproduction apparatus for an optical storage medium. More particularly, the present invention relates to a buffer management device and method thereof simultaneously employing two sets of pointers for respectively decoding and encoding.
2. Description of Related Art
FIG. 1 is a schematic block diagram of a readable/writable DVD drive. Referring to FIG. 1, the buffer memory 14, which may be a dynamic random access memory (DRAM), is used for registering data, and the data is accessed through the buffer memory interface 13. The buffer management device 12 includes a set of pointers and the pointers are used for indicating what operation is being executed by which part inside of the buffer memory 14.
The DVD drive reads digital data from an optical disc by using an optical pick-up (not shown). However, since the data obtained is analog signal because of the reading mechanism, the digital data is obtained by digitally dividing the analog signal by the data slicer 10.
The digital data is registered into the buffer memory 14 first under the instruction of the buffer management device 12, and then decoded by the decoder 11. Besides readable/writable DVD discs including DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, and DVD-RAM etc, the DVD drive has to be backward compatible with CD discs, including CD-ROM, CD-R, CD-RW etc. However, both of the data formats are different, so the decoder 11 including a CD decoder 11a and a DVD decoder 11b are used to decode data with respect to CD discs and DVD discs, respectively. When the host 16 is about to process the decoded data, it reads the decoded data from the buffer memory 14 through the transmission interface 15 and processes it. Wherein, the host 16 may be a video signal processing chip.
When the data is about to be written into an optical disc, the data, for example, obtained from the host 16, is registered into the buffer memory 14 first according to the instruction of the buffer management device 12, and then it is sent to the encoder 17 to be encoded. As the decoder 11, the encoder 17 includes a CD encoder 17a and a DVD encoder 17b to encode data with respect to CD discs and DVD discs, respectively. The encoded data is written into the optical disc by the optical pick-up with the wobble processing unit 18 processing the wobble signal on the optical disc and the write strategy unit 19 providing the appropriate write strategy.
FIG. 2 is a view of a well-known buffer memory. Firstly, the format of an optical disc will be described. The format of an optical disc, for example, a CD disc, has 75 sectors of data per second; each sector has 98 frame data; and each frame has 24 bytes of user data. Furthermore, each frame (or sector) further comprises synchronization pattern, subcode and error correction code (ECC). Wherein, the subcode includes some control bits, e.g. time signal bit, pause signal bit, and bit for determining data format; the synchronization pattern is used for data synchronization; and the ECC is used for data error correction.
Then referring to FIG. 2, the buffer memory includes a plurality of pages, i.e. PAGE 0, PAGE 1, PAGE 2, . . . , PAGE n, and each page is used for storing a sector data. Accordingly, if taking a CD disc as an example, each page of the buffer memory stores 98*24=2352 bytes of user data.
The data is registered into the buffer memory 14 as shown in FIG. 1 after it has been read from the optical disc by the drive, and then it is decoded. During the decoding operation, the sector pointer 21 will point to the PAGE 0 first, here the data (e.g. the ECC) included in the PAGE 0 will be processed by the sector processing unit (not shown) in the buffer management device 12; after the process is done, the sector pointer 21 will point to the PAGE 1 to process the data with respect to the PAGE 1, thus 15 it will continue until the PAGE n is processed before it goes back to the PAGE 0 to process sequentially again. Therefore, such kind of buffer memory 14 is called a ring buffer.
For example, when the sector pointer 21 has finished processing the PAGE 0 and is pointing to the PAGE 1, the read/write pointer 22 will point to the PAGE 0 following the sector pointer 21. Here, the PAGE 1 is processed by the sector processing unit since it is pointed by the sector pointer 21, and the PAGE 1 is decoded by the decoder 11 since it is pointed by the read/write pointer 22. When the read/write pointer 22 points to the PAGE 2 (or when the sector pointer 21 points to the PAGE 3), the host pointer 23 will start following the read/write pointer 22 (or the sector pointer 21) to point to the PAGE 0, indicating the host 16 is processing the data with respect to the PAGE 0 (e.g. the decoded data). Then, the 3 pointers sequentially process the data registered in the buffer memory 14 in the sequence of the sector pointer 21, the read/write pointer 22, and the host pointer 23. In other words, each page of the buffer memory 14 is always pointed by the sector pointer 21 first, then by the read/write pointer 22, and finally by the host pointer 23; and it is pointed repeatedly by the pointers in the aforesaid sequence and processed correspondingly.
When the drive is about to write data into an optical disc, the data is first registered in the buffer memory 14 as shown in FIG. 1 and then is encoded. During the encoding operation, the 3 pointers process the data registered in the buffer memory 14 in the opposite sequence of the decoding operation, i.e., the pointers process the pointed page respectively in the sequence of the host pointer 23, the read/write pointer 22, and the sector pointer 21. However, here the page pointed by the read/write pointer 22 is encoded by the encoder 17.
Although a CD optical disc has been taken as an example, a DVD optical disc can be done likewise, the only difference is that the bytes of user data of each page of the buffer memory are different from that of the CD optical disc because of the different format of the DVD optical disc, but the operation flow can be deduced.
Thus, if a readable/writable DVD drive is about to realize the time shift function (i.e. playing and recording simultaneously), for example, when someone is watching TV program, if the she/he has to leave temporarily, she/he records the TV program in order not to miss it and wishes to continue watching the TV program from where she/he has left at once she/he comes back, here the DVD drive may need to record the playing TV program on the one hand, in another hand it has to play the previously recorded program for the viewer. The well-known practice is to accomplish the time shift function by adopting data-accessing speed higher than playing speed. However, if there are too many faults with the data on the optical disc or the optical disc itself has too many defects, the duty of data recovery will be too heavy that the data-accessing speed is reduced, resulting in frame skips or frame stops when playing images. Moreover, since there is only one set of pointers, the functioning performance will be further reduced because switching between the read operation and the write operation requires initializing the pointer to point to the page of the buffer memory when playing and recording simultaneously.